package com.zx.chatroom.po;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * GroupMembersId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class GroupMembersId implements java.io.Serializable {

	// Fields

	private String userid;
	private String groupid;

	// Constructors

	/** default constructor */
	public GroupMembersId() {
	}

	/** full constructor */
	public GroupMembersId(String userid, String groupid) {
		this.userid = userid;
		this.groupid = groupid;
	}

	// Property accessors

	@Column(name = "USERID", nullable = false, length = 60)
	public String getUserid() {
		return this.userid;
	}

	public void setUserid(String userid) {
		this.userid = userid;
	}

	@Column(name = "GROUPID", nullable = false, length = 60)
	public String getGroupid() {
		return this.groupid;
	}

	public void setGroupid(String groupid) {
		this.groupid = groupid;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof GroupMembersId))
			return false;
		GroupMembersId castOther = (GroupMembersId) other;

		return ((this.getUserid() == castOther.getUserid()) || (this
				.getUserid() != null && castOther.getUserid() != null && this
				.getUserid().equals(castOther.getUserid())))
				&& ((this.getGroupid() == castOther.getGroupid()) || (this
						.getGroupid() != null && castOther.getGroupid() != null && this
						.getGroupid().equals(castOther.getGroupid())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getUserid() == null ? 0 : this.getUserid().hashCode());
		result = 37 * result
				+ (getGroupid() == null ? 0 : this.getGroupid().hashCode());
		return result;
	}

}